Bug 589275 – [csw] Trying to destroy NULL regions
authorCody Russell <bratsche@gnome.org>
Tue, 21 Jul 2009 16:44:25 +0000 (11:44 -0500)
committerCody Russell <bratsche@gnome.org>
Tue, 21 Jul 2009 16:44:25 +0000 (11:44 -0500)
gdk_window_input_shape_combine_mask() can accept NULL for the mask
parameter, but it wasn't checking for NULL before passing the
resulting GdkRegion to gdk_region_destroy().  Fixes #589275

gdk/gdkwindow.c

index ad8ac06de5bc48d1a915950828e013dbdb30fbea..ab2c3966cfd11e32f39e940c6d676cc0d7bf41d7 100644 (file)
@@ -7392,7 +7392,7 @@ gdk_window_merge_child_shapes (GdkWindow *window)
 /**
  * gdk_window_input_shape_combine_mask:
  * @window: a #GdkWindow
- * @mask: shape mask
+ * @mask: shape mask, or %NULL
  * @x: X position of shape mask with respect to @window
  * @y: Y position of shape mask with respect to @window
  *
@@ -7437,7 +7437,8 @@ gdk_window_input_shape_combine_mask (GdkWindow *window,
                                         region,
                                         x, y);
 
-  gdk_region_destroy (region);
+  if (region != NULL)
+    gdk_region_destroy (region);
 }
 
 /**